在腾讯云服务器上查找skills目录

559 字

如何将腾讯云服务器上面的 Openclaw 实例上的skills 那些技能复制应用到我本地部署的 Openclaw 的skills中,技能技能群中,请给出你的方法
这是一个很实际的需求!让我为你提供几种将腾讯云服务器上的OpenClaw skills复制到本地的方法。
📋 方法概览
方法
复杂度
适用场景
优点
缺点
方法1:直接文件复制
⭐⭐
少量skills,简单迁移
直接、快速
可能遗漏配置
方法2:Git同步
⭐⭐⭐
团队协作,版本管理
版本控制,可追溯
需要Git基础
方法3:ClawHub同步
⭐⭐
标准化skills
官方工具,规范
需要发布到hub
方法4:脚本自动化
⭐⭐⭐⭐
批量迁移,复杂环境
自动化,可定制
需要脚本编写
🔧 详细操作步骤
方法1:直接文件复制(推荐初学者)
步骤1:定位skills目录

在腾讯云服务器上查找skills目录

ssh user@your-tencent-cloud-ip "find ~/.openclaw -name 'skills' -type d"

通常位置:

- ~/.openclaw/workspace/skills/

- ~/.openclaw/extensions/ # 扩展skills

- ~/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/skills/ # 系统skills

步骤2:复制skills文件

方法A:使用scp复制整个目录

scp -r user@your-tencent-cloud-ip:~/.openclaw/workspace/skills/* ~/.openclaw/workspace/skills/

方法B:复制特定skill

scp -r user@your-tencent-cloud-ip:~/.openclaw/workspace/skills/feishu-doc ~/.openclaw/workspace/skills/

方法C:使用rsync(更可靠)

rsync -avz user@your-tencent-cloud-ip:~/.openclaw/workspace/skills/ ~/.openclaw/workspace/skills/
步骤3:检查依赖配置

查看skill的配置文件

cat ~/.openclaw/workspace/skills/feishu-doc/SKILL.md

检查是否有额外的配置文件

find ~/.openclaw/workspace/skills/feishu-doc -name ".json" -o -name ".yaml" -o -name "*.yml"
步骤4:更新本地配置

检查OpenClaw配置文件

cat ~/.openclaw/config.yaml | grep -A5 -B5 "skills"

如果需要,添加skill配置

编辑config.yaml,添加或更新skills配置

方法2:Git同步(推荐团队使用)
步骤1:在腾讯云服务器创建Git仓库

在腾讯云服务器上

cd ~/.openclaw/workspace/skills
git init
git add .
git commit -m "Initial skills export"
步骤2:推送到Git远程仓库

创建GitHub/GitLab/Gitee仓库

添加远程仓库

git remote add origin https://github.com/yourname/openclaw-skills.git
git push -u origin main
步骤3:在本地拉取

在本地机器

cd ~/.openclaw/workspace
git clone https://github.com/yourname/openclaw-skills.git skills-new

或合并到现有目录

cd skills
git init
git remote add origin https://github.com/yourname/openclaw-skills.git
git fetch origin
git merge origin/main
方法3:使用ClawHub(标准化方法)
步骤1:在腾讯云服务器打包skill

安装clawhub CLI(如果未安装)

npm install -g @clawhub/cli

进入skill目录

cd ~/.openclaw/workspace/skills/feishu-doc

创建skill包

clawhub pack

这会生成一个 .clawpack 文件

步骤2:发布到ClawHub(可选)

登录ClawHub

clawhub login

发布skill

clawhub publish feishu-doc.clawpack
步骤3:在本地安装

方法A:从ClawHub安装

clawhub install feishu-doc

方法B:直接安装包文件

将.clawpack文件复制到本地

scp user@your-tencent-cloud-ip:~/feishu-doc.clawpack ./
clawhub install feishu-doc.clawpack
方法4:脚本自动化(批量迁移)
创建迁移脚本 migrate-skills.sh:

!/bin/bash

migrate-skills.sh - 从远程服务器迁移skills到本地

REMOTE_USER="your_user"
REMOTE_HOST="your_tencent_ip"
REMOTE_SKILLS_DIR="~/.openclaw/workspace/skills"
LOCAL_SKILLS_DIR="~/.openclaw/workspace/skills"

echo "开始迁移skills..."

1. 获取远程skills列表

echo "获取远程skills列表..."
ssh $REMOTE_USER@$REMOTE_HOST "ls -la $REMOTE_SKILLS_DIR" > remote_skills.txt

2. 获取本地skills列表

echo "获取本地skills列表..."
ls -la $LOCAL_SKILLS_DIR > local_skills.txt

3. 比较并复制缺失的skills

echo "比较skills差异..."
while read -r skill; do
if $skill == "SKILL.md"

检查本地是否已存在

if [ ! -d "$LOCAL_SKILLS_DIR/$skill_name" ]; then
echo "复制skill: $skill_name"
scp -r $REMOTE_USER@$REMOTE_HOST:$REMOTE_SKILLS_DIR/$skill_name $LOCAL_SKILLS_DIR/
else
echo "skill已存在: $skill_name"
fi
fi
done < <(ssh $REMOTE_USER@$REMOTE_HOST "find $REMOTE_SKILLS_DIR -name 'SKILL.md'")

echo "迁移完成!"
运行脚本:
chmod +x migrate-skills.sh
./migrate-skills.sh
🎯 推荐方案:组合方法
最佳实践流程:

阶段1:快速测试(方法1)

scp -r user@tencent-ip:~/.openclaw/workspace/skills/feishu-doc ~/.openclaw/workspace/skills/

阶段2:批量迁移(方法4)

./migrate-skills.sh

阶段3:标准化管理(方法2)

cd ~/.openclaw/workspace/skills
git init

... 建立Git管理

⚠️ 注意事项和常见问题
1. 权限问题

确保本地目录有写入权限

chmod -R 755 ~/.openclaw/workspace/skills
2. 配置文件差异
腾讯云和本地的API密钥可能不同
网络配置可能不同
文件路径可能不同
解决方案:

检查并更新配置文件

find ~/.openclaw/workspace/skills -name "config.json" -o -name "settings.yaml" | xargs grep -l "tencent"
3. 依赖检查

检查skill的依赖

cat ~/.openclaw/workspace/skills/feishu-doc/SKILL.md | grep -i "depend|require|install"

安装缺失的依赖

例如,如果skill需要特定Python包

pip install -r requirements.txt
4. 环境变量

检查是否需要环境变量

cat ~/.openclaw/workspace/skills/feishu-doc/SKILL.md | grep -i "env|API_KEY|SECRET"

设置环境变量

export FEISHU_APP_ID="your_app_id"
export FEISHU_APP_SECRET="your_secret"
🔍 验证迁移结果
验证步骤:

1. 检查文件完整性

find ~/.openclaw/workspace/skills -name "SKILL.md" | wc -l

2. 测试skill功能

例如测试feishu-doc

echo "测试feishu-doc skill..." && \
cat ~/.openclaw/workspace/skills/feishu-doc/SKILL.md | head -20

3. 检查OpenClaw识别

重启OpenClaw或发送测试指令

快速测试脚本:

!/bin/bash

test-skills.sh

echo "=== Skills迁移验证 ==="
echo "1. 检查skills目录结构..."
ls -la ~/.openclaw/workspace/skills/

echo -e "\n2. 检查SKILL.md文件..."
find ~/.openclaw/workspace/skills -name "SKILL.md" -exec basename {} \; | sort

echo -e "\n3. 检查配置文件..."
find ~/.openclaw/workspace/skills -name ".json" -o -name ".yaml" -o -name "*.yml" | head -10

echo -e "\n4. 验证完成!"
🚀 高级技巧
1. 选择性同步

只同步特定类型的skills

rsync -avz --include="/" --include="feishu-" --exclude="*" \
user@tencent-ip:~/.openclaw/workspace/skills/ \
~/.openclaw/workspace/skills/
2. 增量同步

使用rsync进行增量同步(只同步变化)

rsync -avz --update user@tencent-ip:~/.openclaw/workspace/skills/ \
~/.openclaw/workspace/skills/
3. 备份恢复点

创建备份

cp -r ~/.openclaw/workspace/skills ~/.openclaw/workspace/skills_backup_$(date +%Y%m%d)

恢复备份

cp -r ~/.openclaw/workspace/skills_backup_20260304/* ~/.openclaw/workspace/skills/
💡 我的建议
对于你的情况,我推荐:
第一步:快速测试(今天)

先复制1-2个关键skill测试

scp -r user@tencent-ip:~/.openclaw/workspace/skills/feishu-doc ~/.openclaw/workspace/skills/
scp -r user@tencent-ip:~/.openclaw/workspace/skills/github ~/.openclaw/workspace/skills/

第二步:批量迁移(明天)

使用脚本批量迁移

./migrate-skills.sh

第三步:建立管理(长期)

建立Git管理

cd ~/.openclaw/workspace/skills
git init
git add .
git commit -m "迁移腾讯云skills到本地"

你现在想从哪个skill开始测试?或者需要我帮你编写特定的迁移脚本?